package TestOverWrite;

public class TestOverWrite {
	public static void main(String [] args) {
		Person Jack=new Person("Jack");
		Student Mike=new Student("Mike");
		Person Kevin=new Person(3,"Kevin");
		Student Jason=new Student(4,"Jason","Jxust");
		Student Rose=new Student("Rose");
		Jack.setId(1);
		Mike.setId(2);
		Mike.setSchool("Jxust");
		Jack.display();
		Mike.display();
		Kevin.display();
		Jason.display();
		Rose.display();
	}

}

class Person {
	protected int id;
	protected String name;
	
	Person(int id,String name) {
		this.name=name;
		this.id=id;
	}
	
	Person(String name) {
		this.id=0;
		this.name=name;
	}
	
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id=id;
	}
	
	public String getName() {
		return name;
	}
	
	public void display() {
		System.out.println("id = "+id+" name = "+name);
	}
}

class Student extends Person {
	Student(int id, String name) {
		this(id, name,"Jxust");
	}
	
	Student(String name) {
		this(0,name,"Jxust");
	}
	
	Student(int id, String name, String school) {
		super(id,name);
		this.school=school;
	}

	private String school;
	
	public void setSchool(String school) {
		this.school=school;
	}
	
	public String getSchool() {
		return school;
	}
	
	public void display() {
		System.out.println("id = "+id+" name = "+name+" school = "+school);
	}
}